﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.AndonManagement;

namespace Digitalmes.Model.AndonManagement
{
    /// <summary>
    /// 问题记录
    /// </summary>
	[Table("IssueRecord")]

    [Display(Name = "_Model.IssueRecord")]
    public class IssueRecord : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._IssueRecord._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._IssueRecord._OpId")]
        [Comment("问题工位")]
        public long? OpId { get; set; }
        [Display(Name = "_Model._IssueRecord._OpName")]
        [Comment("工位名称")]
        public string OpName { get; set; }
        [Display(Name = "_Model._IssueRecord._IssueType")]
        [Comment("问题类型")]
        public IssueType IssueType { get; set; }
        [Display(Name = "_Model._IssueRecord._IssueType")]
        [Comment("问题类型")]
        public long? IssueTypeId { get; set; }
        [Display(Name = "_Model._IssueRecord._IssueTypeName")]
        [Comment("问题名称")]
        public string IssueTypeName { get; set; }
        [Display(Name = "_Model._IssueRecord._ReportTime")]
        [Comment("上报时间")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public DateTime? ReportTime { get; set; }
        [Display(Name = "_Model._IssueRecord._Reporter")]
        [Comment("上报人")]
        public string Reporter { get; set; }
        [Display(Name = "_Model._IssueRecord._Description")]
        [Comment("问题描述")]
        public string Description { get; set; }
        [Display(Name = "_Model._IssueRecord._Handler")]
        [Comment("处理人")]
        public string Handler { get; set; }
        [Display(Name = "_Model._IssueRecord._HandleTime")]
        [Comment("处理时间")]
        public DateTime? HandleTime { get; set; }
        [Display(Name = "_Model._IssueRecord._HandleResult")]
        [Comment("处理结果")]
        public string HandleResult { get; set; }
        [Display(Name = "_Model._IssueRecord._Status")]
        [Comment("状态")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public IssueStatusEnum? Status { get; set; }
        [Display(Name = "_Model._IssueRecord._Remark")]
        [Comment("备用")]
        public string Remark { get; set; }
        [Display(Name = "_Model._IssueRecord._Station")]
        [Comment("站点")]
        public AndonStation Station { get; set; }
        [Display(Name = "_Model._IssueRecord._Station")]
        [Comment("站点")]
        public long? StationId { get; set; }
        [Display(Name = "_Model._IssueRecord._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
